package com.hbnu.exercise.File;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Demo05
{
    public static void main(String[] args)
    {
        String filepath = "E://writedemo.txt";
        File file = new File(filepath);

        try
        {
            Writer writer = new FileWriter(file);

            String content = "湖北师范大学";
            writer.write(content);

            writer.close();
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }
}
